﻿using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;

namespace DataTransformationTasks.BaseDriver
{
    public static class LoggerFactory
    {
        private static ILoggerFactory _loggerFactory = NullLoggerFactory.Instance;

        public static void SetFactory(ILoggerFactory loggerFactory)
        {
            _loggerFactory = loggerFactory;
        }

        internal static ILogger CreateLogger(string categorName)
        {
            return _loggerFactory.CreateLogger(categorName);
        }

        internal static ILogger CreateLogger<T>()
        {
            return _loggerFactory.CreateLogger<T>();
        }

        internal static ILogger CreateLogger(Type type)
        {
            return _loggerFactory.CreateLogger(type);
        }
    }
}
